<?php
/*
 * sbook php framework
 *
 * NOTE: We are using PHP5 class autoloading. Check the 'libs/paths.php' file.
 */
// Basic path independence constants
define ('DS', DIRECTORY_SEPARATOR);
define ('ROOT', dirname(__FILE__).DS);

// Setup the environmnet in another place
require(ROOT.'libs/setup.php');

// create the required objects to process and respond to the request
$routes = config::file()->get('routes');
$mapper   = new urlmapper($routes);

// read and interpret the request
$request  = $mapper->parse($_REQUEST['url'],$_SERVER['REQUEST_METHOD']);
$response = $request->process();
// send the response back in an appropriate form
$response->render();
?>
